Skip to content

Fix @azureBaseType doc example to reference a real resource model#4755

Open
markcowl with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-azure-basetype-doc-example
Open

Fix @azureBaseType doc example to reference a real resource model#4755
markcowl with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-azure-basetype-doc-example

Conversation

Copilot AI commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

The @azureBaseType doc example referenced ...AgentProperties (which is internal) and ...AgentToolProperty (which does not exist), making it non-compilable.

Replaced with a valid example showing the decorator applied to a TrackedResource model, matching actual usage:

model MyAgentProperties {
  displayName: string;
  description: string;
}

@azureBaseType(#{ baseType: "Agent", version: "2024-06-01" })
model MyAgent is TrackedResource<MyAgentProperties> {
  @key("myAgentName") @segment("myAgents") name: string;
}
  • Source: lib/base-types/base-types.tsp — corrected the @example block
  • Generated: generated-defs/Azure.ResourceManager.BaseTypes.ts, README.md, reference/decorators.md — regenerated via pnpm regen-docs

The example previously referenced non-existent spreads (AgentProperties is
internal, AgentToolProperty does not exist). Replace with a compilable
resource-model example that shows the decorator applied to a TrackedResource,
matching actual usage in the codebase. Regenerate reference docs.

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates labels Jun 30, 2026
Copilot AI changed the title [WIP] Fix @azureBaseType doc example to reference a real resource model Fix @azureBaseType doc example to reference a real resource model Jun 30, 2026
Copilot AI requested a review from markcowl June 30, 2026 02:47

@markcowl markcowl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot Pull the latest from main, make the suggested changes, rebuild, regenerate docs, verify that all files are correctly formatted and that only the changes associated with this PR are in the PR diff

* @example
* ```typespec
* @azureBaseType(#{ baseType: "Agent", version: "2024-06-01" })
* model MyAgentProperties {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These samples are still not realistic. Use the 'ContosoApplianceDefinition, ContosoApplianceProperties and ContosoApplianceAgent definitio0ns from the agent sample spec: https://github.com/Azure/typespec-azure/blob/main/packages/samples/specs/resource-manager/resource-types/agent/main.tsp

To make the agent you will decorate with the decorator.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the example to use ContosoApplianceDefinition, ContosoApplianceProperties, and ContosoApplianceAgent from the agent sample spec. Also merged latest main, rebuilt, regenerated docs, and formatted.

Copilot AI and others added 2 commits June 30, 2026 21:02
…etype-doc-example

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
…ample spec

Use ContosoApplianceDefinition, ContosoApplianceProperties, and
ContosoApplianceAgent from the agent sample spec for a realistic example.
Merge latest main, rebuild, regenerate docs, and format.

Co-authored-by: markcowl <1054056+markcowl@users.noreply.github.com>
Copilot AI requested a review from markcowl June 30, 2026 21:07
@markcowl markcowl marked this pull request as ready for review June 30, 2026 21:11
@azure-sdk-automation

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • @azure-tools/typespec-azure-resource-manager
Show changes

@azure-tools/typespec-azure-resource-manager - internal ✏️

Fix @azureBaseType doc example to reference a real resource model instead of non-existent spreads

@pkg-pr-new

pkg-pr-new Bot commented Jun 30, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@4755

commit: e04aad7

@azure-sdk-automation

Copy link
Copy Markdown
Contributor

You can try these changes here

🛝 Playground 🌐 Website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Automated][azure-resource-manager] Fix @azureBaseType doc example to reference a real resource model

3 participants